﻿<!DOCTYPE html>
<!--隔离盲板动态管理状态记录表-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>

<body>
    <div id="app" v-cloak class="popupW100">
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px"
            size="mini">
            <el-row>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.Position" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{IsolationBlindTable.Position+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" :offset="2">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.Numbering" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{IsolationBlindTable.Numbering+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{IsolationBlindTable.InstallationTime+mark.m}}
                                </template>
                                <el-date-picker slot="suffix" v-model="Form.InstallationTime" type="date" size="mini"
                                    format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择时间">
                                </el-date-picker>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" :offset="2">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.InstallationManager" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{IsolationBlindTable.InstallationManager+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>

            <el-row>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{IsolationBlindTable.ExtractionTime+mark.m}}
                                </template>
                                <el-date-picker slot="suffix" v-model="Form.ExtractionTime" type="date" size="mini"
                                    format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择时间">
                                </el-date-picker>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" :offset="2">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.ExtractPersonCharge" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{IsolationBlindTable.ExtractPersonCharge+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>

            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnConfirm}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>

    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                //父业传参
                id: '',
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    Position: "",
                    Numbering: "",
                    InstallationTime: "",
                    InstallationManager: "",
                    ExtractionTime: "",
                    ExtractPersonCharge: "",
                    Pid: "",
                },
                RiskLevel: [],
                //表单验证
                rules: {
                    Position: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 50), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    Numbering: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 50), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    InstallationTime: [
                        verification.NotNull,

                    ],
                    InstallationManager: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 100), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    ExtractionTime: [
                        verification.NotNull,

                    ],
                    ExtractPersonCharge: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 100), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ]
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                getTime: function (dt) {
                    var year = dt.getFullYear(); //年
                    var month = dt.getMonth() + 1; //月
                    var date = dt.getDate(); //日
                    month = month < 10 ? "0" + month : month;
                    date = date < 10 ? "0" + date : date;
                    var str = year + "-" + month + "-" + date;
                    return str;
                },
                //提交数据
                onSubmitForm: function () {
                    var list = parent.app.Form.IsolationBlindList;
                    for (var i = 0; i < list.length; i++) {
                        if (list[i].id == this.id) {
                            this.id = list[i].Pid;
                            list.splice(i, 1);
                        }
                    }
                    list.push({
                        Position: this.Form.Position,
                        Numbering: this.Form.Numbering,
                        InstallationTime: this.Form.InstallationTime,
                        InstallationManager: this.Form.InstallationManager,
                        ExtractionTime: this.Form.ExtractionTime,
                        ExtractPersonCharge: this.Form.ExtractPersonCharge,
                        id: Mock.Random.id(),
                        Pid: this.id,
                    });
                    parent.app.ListItem.dialogVisible = false;
                },
                getData: function () {
                    getData(this, '/api/IsolationBlindTable/getItem?id=' + this.id);
                }
            },
            mounted: function () {
                this.id = getUrlParam("id");
                this.getData();
            }
        });
    </script>
</body>

</html>